import 'package:enter_prise_web/util/MyDio.dart';
import 'package:get/get.dart';

class staffController extends GetxController {
  final MyDio dio = MyDio();
  var staffs = [].obs;
  var selectCount = 0.obs;
  var groupName = ''.obs;

  var groups = [].obs;
  @override
  void onInit() {
    super.onInit();
    getGroupData();
  }

  void getGroupData() async {
    groups.clear();
    var response = await dio.requestData("/group/listAll",method: "GET");
    try {
      groups.value = response.data;
    } catch (e) {
      print(e);
    }
    print("我刷新数据了");
    update(['group_list']);
  }

  void refreshData() {
    getGroupData();
  }
}
